// ----------------------------------------------------------------------------
//
// Installer class for the WERDataService windows service.
//
// ----------------------------------------------------------------------------
using System.ServiceProcess;
using System.Configuration.Install;
using System.ComponentModel;

namespace WERServices
{
    /// <summary>
    /// Installer class for the WERDataService windows service.
    /// </summary>
    [RunInstaller(true)]
    public class WERDataServiceInstaller : Installer
    {
        public WERDataServiceInstaller()
        {
            //
            // Instantiate and configure a ServiceProcessInstaller.
            //
            ServiceProcessInstaller werDataServiceProcessInstaller = new ServiceProcessInstaller();
            werDataServiceProcessInstaller.Account = ServiceAccount.LocalSystem;


            //
            // Instantiate and configure a ServiceInstaller.
            //
            ServiceInstaller werDataServiceInstaller = new ServiceInstaller();
            werDataServiceInstaller.DisplayName = "WER Data Sync Service";
            werDataServiceInstaller.ServiceName = "WERDataSyncService";
            werDataServiceInstaller.Description = "Syncronizes the WER data with the local WER Database using the WER Data Services Client API.";
            werDataServiceInstaller.StartType = ServiceStartMode.Automatic;

            //
            // Add both, the service process and service installers
            // to the installers collection.
            //
            Installers.Add(werDataServiceProcessInstaller);
            Installers.Add(werDataServiceInstaller);
        }
    }
}